Moderator note: this might be in a completely inappropriate forum. If so, please move.
Someone asked me to have a look at a RHEL ES 4 server. The original problem description was that "apache does not want to serve text files". After I proved them wrong, the problem is that a browser receives a 403 error when one specific file is requested.
SELinux seems to cause the problem.
error
Code:
Feb 9 08:23:15 localhost kernel: audit(1234160595.716:0): avc: denied { getattr } for pid=862 exe=/usr/sbin/httpd path=/var/www/html/iptvo.txt dev=dm-0 ino=507796 scontext=user_u:system_r:httpd_t tcontext=root:object_r:var_t tclass=file
dir listing
Code:
[wim@localhost html]$ ls -l *.txt
-rw-r--r-- 1 root root 44226 Feb 6 13:55 iplab.txt
-rw-r--r-- 1 root root 46050 Feb 6 14:48 iptvo2.txt
-rw-r--r-- 1 root root 46050 Jan 15 15:14 iptvo.txt
[wim@localhost html]$
/etc/selinux/config
Code:
SELINUX=enforcing
SELINUXTYPE=targeted
What has been done:
- other text files work (checked permissions)
- tried to find something that refers to iptvo.txt in the apache config
- grepped files in /etc/selinux/targeted for references to txt and iptvo
- read up on SELinux, but could not find what I was looking for
I'm a bit reluctant at this moment to simply rename the file (copying the file to iptvo2.txt and requesting that file does not show the issue) as it might solve the issue without me understanding what is happening
Can somebody explain and point me in the right direction to solve the issue?
PS I'm not familiar with SELinux at all (work with Slackware servers normally).